package com.xlh.service.courseTest;

import com.xlh.dto.PageDTO;
import com.xlh.dto.course.ChapterBasicInfoDTO;
import com.xlh.dto.course.ZtreeDTO;
import com.xlh.dto.courseTest.QuestionListDTO;
import com.xlh.dto.courseTest.QuestionRepositoryDropdownListDTO;
import com.xlh.dto.courseTest.TypeQuestionListDTO;
import com.xlh.param.courseTest.QuestionRepositoryAddQuestionParam;
import com.xlh.param.courseTest.QuestionRepositoryUpdateQuestionParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author zhr 2019/4/26
 * 考试题库业务操作类
 */
public interface RepositoryService {
    QuestionRepositoryDropdownListDTO dropdownList(Long courseId, Integer businessType,Integer type);

    PageDTO<QuestionListDTO> questionList(Integer pageNum, Integer pageSize, String keyWord, Long courseId, Long chapterId, Integer questionType, Integer businessType, Integer type);

    Long addQuestion(Long courseId, Integer businessType, QuestionRepositoryAddQuestionParam questionRepositoryAddQuestionParam);

    List<QuestionListDTO> presetQuestionList(String keyWord, Long courseDropdownId, Long courseId, Long chapterId, Integer questionType, Integer businessType);

    void importFromPreset(Long courseId, Integer businessType, List<Long> questionIds);

    void getExcelModel(HttpServletResponse res, HttpServletRequest req, Integer businessType);

    void importFromExcel(MultipartFile file, Long courseId, Integer businessType);

    void importFromExcel(MultipartFile file, Long courseId, Integer businessType, Long chapterId);

    QuestionListDTO showUpdateQuestion(Long courseId, Long questionId);

    void updateQuestion(Long courseId, Long questionId, QuestionRepositoryUpdateQuestionParam param);

    void deleteQuestion(Long courseId, List<Long> questionIds);

    List<TypeQuestionListDTO> listQuestionByType(Long chapterId, Long courseId, Integer businessType);

    List<ZtreeDTO> getCourseChapterList();

    List<ChapterBasicInfoDTO> chapterList(List<Long> courseIds);
    List<ChapterBasicInfoDTO> chapterListOwner(List<Long> courseIds);

    /**
     * 已选择的预制列表
     */
    List<QuestionListDTO> presetChosenList(Long courseId);
}
